(function(angular) {
    "use strict";

    var directive_module = angular.module("cloapCertificateApp.directive");

    directive_module.directive("confirmClick", function($window) {
        return {
            scope: {
                agreeCallback: "&"
            },

            link: function(scope, element, attr) {
                var msg = "确定?" || attr.msg;

                element.on("click", function() {
                    if ($window.confirm(msg)) {
                        scope.agreeCallback();
                    }
                });
            }
        };
    });
}(angular));
